﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Gluten.Models
{
    [Serializable]
    public class SelectPages
    {

        public string Action { get; set; }

        public List<bool> PagesFlag { get; set; }

        public List<Guid> PageGuid { get; set; }

        public Guid Destination { get; set; }

        public List<Guid> GetOnlyChecked()
        {
            var targetGuids = new List<Guid>();
            if (PagesFlag != null)
            {
                for (int i = 0; i < PagesFlag.Count; i++)
                {
                    if (PagesFlag[i])
                    {
                        targetGuids.Add(PageGuid[i]);
                    }
                }
            }
            return targetGuids;
        }

    }
}